<template>
	<view>
		<html2canva-pdf ref="html2pdf">
			<u-parse :content="htmls"></u-parse>
		</html2canva-pdf>
	</view>
</template>

<script>
	import {
		getCityNoticeDetail
	} from "@/api/supervise/work.js"
	import {
		genNoticeDetail
	} from "@/utils/genNoticeDetail.js"
	export default {
		data() {
			return {
				activityId: 0,
				activityName: "",
				noticeId: 0,
				areacode: 0,
				areaName: "",
				htmls: ""
			}
		},
		onLoad(option) {
			this.activityId = option.activityId;
			this.activityName = option.activityName;
			this.noticeId = option.noticeId;
			this.areacode = option.areacode;
			this.areaName = option.areaName.substring(0, option.areaName.length - 5);
			this.getCityNoticeDetail();
		},
		methods: {
			getCityNoticeDetail() {
				getCityNoticeDetail(this.activityId, this.noticeId, this.areacode).then(res => {
					this.htmls = genNoticeDetail(0, res, this.activityName, this.areaName);
				})
			}
		}
	}
</script>

<style>

</style>